<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>DWARF (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="DWARF (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="DWARF (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Debugging-Info.html" rel="up" title="Debugging Info">
<link href="VMS-Debug.html" rel="next" title="VMS Debug">
<link href="All-Debuggers.html" rel="prev" title="All Debuggers">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="DWARF">
<div class="nav-panel">
<p>
Next: <a href="VMS-Debug.html" accesskey="n" rel="next">Macros for VMS Debug Format</a>, Previous: <a href="All-Debuggers.html" accesskey="p" rel="prev">Macros Affecting All Debugging Formats</a>, Up: <a href="Debugging-Info.html" accesskey="u" rel="up">Controlling Debugging Information Format</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Macros-for-DWARF-Output"><span>18.21.2 Macros for DWARF Output<a class="copiable-link" href="#Macros-for-DWARF-Output"> &para;</a></span></h4>

<p>Here are macros for DWARF output.
</p>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-DWARF2_005fDEBUGGING_005fINFO"><span class="category-def">Macro: </span><span><strong class="def-name">DWARF2_DEBUGGING_INFO</strong><a class="copiable-link" href="#index-DWARF2_005fDEBUGGING_005fINFO"> &para;</a></span></dt>
<dd><p>Define this macro if GCC should produce dwarf version 2 format
debugging output in response to the <samp class="option">-g</samp> option.
</p>
<p>To support optional call frame debugging information, you must also
define <code class="code">INCOMING_RETURN_ADDR_RTX</code> and either set
<code class="code">RTX_FRAME_RELATED_P</code> on the prologue insns if you use RTL for the
prologue, or call <code class="code">dwarf2out_def_cfa</code> and <code class="code">dwarf2out_reg_save</code>
as appropriate from <code class="code">TARGET_ASM_FUNCTION_PROLOGUE</code> if you don&rsquo;t.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fDWARF_005fCALLING_005fCONVENTION"><span class="category-def">Target Hook: </span><span><code class="def-type">int</code> <strong class="def-name">TARGET_DWARF_CALLING_CONVENTION</strong> <code class="def-code-arguments">(const_tree <var class="var">function</var>)</code><a class="copiable-link" href="#index-TARGET_005fDWARF_005fCALLING_005fCONVENTION"> &para;</a></span></dt>
<dd><p>Define this to enable the dwarf attribute <code class="code">DW_AT_calling_convention</code> to
be emitted for each function.  Instead of an integer return the enum
value for the <code class="code">DW_CC_</code> tag.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-DWARF2_005fFRAME_005fINFO"><span class="category-def">Macro: </span><span><strong class="def-name">DWARF2_FRAME_INFO</strong><a class="copiable-link" href="#index-DWARF2_005fFRAME_005fINFO"> &para;</a></span></dt>
<dd><p>Define this macro to a nonzero value if GCC should always output
Dwarf 2 frame information.  If <code class="code">TARGET_EXCEPT_UNWIND_INFO</code>
(see <a class="pxref" href="Exception-Region-Output.html">Assembler Commands for Exception Regions</a>) returns <code class="code">UI_DWARF2</code>, and
exceptions are enabled, GCC will output this information not matter
how you define <code class="code">DWARF2_FRAME_INFO</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fDEBUG_005fUNWIND_005fINFO"><span class="category-def">Target Hook: </span><span><code class="def-type">enum unwind_info_type</code> <strong class="def-name">TARGET_DEBUG_UNWIND_INFO</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fDEBUG_005fUNWIND_005fINFO"> &para;</a></span></dt>
<dd><p>This hook defines the mechanism that will be used for describing frame
unwind information to the debugger.  Normally the hook will return
<code class="code">UI_DWARF2</code> if DWARF 2 debug information is enabled, and
return <code class="code">UI_NONE</code> otherwise.
</p>
<p>A target may return <code class="code">UI_DWARF2</code> even when DWARF 2 debug information
is disabled in order to always output DWARF 2 frame information.
</p>
<p>A target may return <code class="code">UI_TARGET</code> if it has ABI specified unwind tables.
This will suppress generation of the normal debug frame unwind information.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-DWARF2_005fASM_005fLINE_005fDEBUG_005fINFO"><span class="category-def">Macro: </span><span><strong class="def-name">DWARF2_ASM_LINE_DEBUG_INFO</strong><a class="copiable-link" href="#index-DWARF2_005fASM_005fLINE_005fDEBUG_005fINFO"> &para;</a></span></dt>
<dd><p>Define this macro to be a nonzero value if the assembler can generate Dwarf 2
line debug info sections.  This will result in much more compact line number
tables, and hence is desirable if it works.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-DWARF2_005fASM_005fVIEW_005fDEBUG_005fINFO"><span class="category-def">Macro: </span><span><strong class="def-name">DWARF2_ASM_VIEW_DEBUG_INFO</strong><a class="copiable-link" href="#index-DWARF2_005fASM_005fVIEW_005fDEBUG_005fINFO"> &para;</a></span></dt>
<dd><p>Define this macro to be a nonzero value if the assembler supports view
assignment and verification in <code class="code">.loc</code>.  If it does not, but the
user enables location views, the compiler may have to fallback to
internal line number tables.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fRESET_005fLOCATION_005fVIEW"><span class="category-def">Target Hook: </span><span><code class="def-type">int</code> <strong class="def-name">TARGET_RESET_LOCATION_VIEW</strong> <code class="def-code-arguments">(rtx_insn *<var class="var"></var>)</code><a class="copiable-link" href="#index-TARGET_005fRESET_005fLOCATION_005fVIEW"> &para;</a></span></dt>
<dd><p>This hook, if defined, enables -ginternal-reset-location-views, and
uses its result to override cases in which the estimated min insn
length might be nonzero even when a PC advance (i.e., a view reset)
cannot be taken for granted.
</p>
<p>If the hook is defined, it must return a positive value to indicate
the insn definitely advances the PC, and so the view number can be
safely assumed to be reset; a negative value to mean the insn
definitely does not advance the PC, and os the view number must not
be reset; or zero to decide based on the estimated insn length.
</p>
<p>If insn length is to be regarded as reliable, set the hook to
<code class="code">hook_int_rtx_insn_0</code>.
</p></dd></dl>

<dl class="first-deftypevr">
<dt class="deftypevr" id="index-TARGET_005fWANT_005fDEBUG_005fPUB_005fSECTIONS"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_WANT_DEBUG_PUB_SECTIONS</strong><a class="copiable-link" href="#index-TARGET_005fWANT_005fDEBUG_005fPUB_005fSECTIONS"> &para;</a></span></dt>
<dd><p>True if the <code class="code">.debug_pubtypes</code> and <code class="code">.debug_pubnames</code> sections
should be emitted.  These sections are not used on most platforms, and
in particular GDB does not use them.
</p></dd></dl>

<dl class="first-deftypevr">
<dt class="deftypevr" id="index-TARGET_005fDELAY_005fSCHED2"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_DELAY_SCHED2</strong><a class="copiable-link" href="#index-TARGET_005fDELAY_005fSCHED2"> &para;</a></span></dt>
<dd><p>True if sched2 is not to be run at its normal place.
This usually means it will be run as part of machine-specific reorg.
</p></dd></dl>

<dl class="first-deftypevr">
<dt class="deftypevr" id="index-TARGET_005fDELAY_005fVARTRACK"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_DELAY_VARTRACK</strong><a class="copiable-link" href="#index-TARGET_005fDELAY_005fVARTRACK"> &para;</a></span></dt>
<dd><p>True if vartrack is not to be run at its normal place.
This usually means it will be run as part of machine-specific reorg.
</p></dd></dl>

<dl class="first-deftypevr">
<dt class="deftypevr" id="index-TARGET_005fNO_005fREGISTER_005fALLOCATION"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_NO_REGISTER_ALLOCATION</strong><a class="copiable-link" href="#index-TARGET_005fNO_005fREGISTER_005fALLOCATION"> &para;</a></span></dt>
<dd><p>True if register allocation and the passes
following it should not be run.  Usually true only for virtual assembler
targets.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-ASM_005fOUTPUT_005fDWARF_005fDELTA"><span class="category-def">Macro: </span><span><strong class="def-name">ASM_OUTPUT_DWARF_DELTA</strong> <var class="def-var-arguments">(<var class="var">stream</var>, <var class="var">size</var>, <var class="var">label1</var>, <var class="var">label2</var>)</var><a class="copiable-link" href="#index-ASM_005fOUTPUT_005fDWARF_005fDELTA"> &para;</a></span></dt>
<dd><p>A C statement to issue assembly directives that create a difference
<var class="var">lab1</var> minus <var class="var">lab2</var>, using an integer of the given <var class="var">size</var>.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-ASM_005fOUTPUT_005fDWARF_005fVMS_005fDELTA"><span class="category-def">Macro: </span><span><strong class="def-name">ASM_OUTPUT_DWARF_VMS_DELTA</strong> <var class="def-var-arguments">(<var class="var">stream</var>, <var class="var">size</var>, <var class="var">label1</var>, <var class="var">label2</var>)</var><a class="copiable-link" href="#index-ASM_005fOUTPUT_005fDWARF_005fVMS_005fDELTA"> &para;</a></span></dt>
<dd><p>A C statement to issue assembly directives that create a difference
between the two given labels in system defined units, e.g. instruction
slots on IA64 VMS, using an integer of the given size.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-ASM_005fOUTPUT_005fDWARF_005fOFFSET"><span class="category-def">Macro: </span><span><strong class="def-name">ASM_OUTPUT_DWARF_OFFSET</strong> <var class="def-var-arguments">(<var class="var">stream</var>, <var class="var">size</var>, <var class="var">label</var>, <var class="var">offset</var>, <var class="var">section</var>)</var><a class="copiable-link" href="#index-ASM_005fOUTPUT_005fDWARF_005fOFFSET"> &para;</a></span></dt>
<dd><p>A C statement to issue assembly directives that create a
section-relative reference to the given <var class="var">label</var> plus <var class="var">offset</var>, using
an integer of the given <var class="var">size</var>.  The label is known to be defined in the
given <var class="var">section</var>.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-ASM_005fOUTPUT_005fDWARF_005fPCREL"><span class="category-def">Macro: </span><span><strong class="def-name">ASM_OUTPUT_DWARF_PCREL</strong> <var class="def-var-arguments">(<var class="var">stream</var>, <var class="var">size</var>, <var class="var">label</var>)</var><a class="copiable-link" href="#index-ASM_005fOUTPUT_005fDWARF_005fPCREL"> &para;</a></span></dt>
<dd><p>A C statement to issue assembly directives that create a self-relative
reference to the given <var class="var">label</var>, using an integer of the given <var class="var">size</var>.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-ASM_005fOUTPUT_005fDWARF_005fDATAREL"><span class="category-def">Macro: </span><span><strong class="def-name">ASM_OUTPUT_DWARF_DATAREL</strong> <var class="def-var-arguments">(<var class="var">stream</var>, <var class="var">size</var>, <var class="var">label</var>)</var><a class="copiable-link" href="#index-ASM_005fOUTPUT_005fDWARF_005fDATAREL"> &para;</a></span></dt>
<dd><p>A C statement to issue assembly directives that create a reference to the
given <var class="var">label</var> relative to the dbase, using an integer of the given <var class="var">size</var>.
</p></dd></dl>

<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-ASM_005fOUTPUT_005fDWARF_005fTABLE_005fREF"><span class="category-def">Macro: </span><span><strong class="def-name">ASM_OUTPUT_DWARF_TABLE_REF</strong> <var class="def-var-arguments">(<var class="var">label</var>)</var><a class="copiable-link" href="#index-ASM_005fOUTPUT_005fDWARF_005fTABLE_005fREF"> &para;</a></span></dt>
<dd><p>A C statement to issue assembly directives that create a reference to
the DWARF table identifier <var class="var">label</var> from the current section.  This
is used on some systems to avoid garbage collecting a DWARF table which
is referenced by a function.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fASM_005fOUTPUT_005fDWARF_005fDTPREL"><span class="category-def">Target Hook: </span><span><code class="def-type">void</code> <strong class="def-name">TARGET_ASM_OUTPUT_DWARF_DTPREL</strong> <code class="def-code-arguments">(FILE *<var class="var">file</var>, int <var class="var">size</var>, rtx <var class="var">x</var>)</code><a class="copiable-link" href="#index-TARGET_005fASM_005fOUTPUT_005fDWARF_005fDTPREL"> &para;</a></span></dt>
<dd><p>If defined, this target hook is a function which outputs a DTP-relative
reference to the given TLS symbol of the specified size.
</p></dd></dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="VMS-Debug.html">Macros for VMS Debug Format</a>, Previous: <a href="All-Debuggers.html">Macros Affecting All Debugging Formats</a>, Up: <a href="Debugging-Info.html">Controlling Debugging Information Format</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
